# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-bitarray
pkgname=('python2-bitarray' 'python-bitarray')
_pkgname=bitarray
pkgver=3.5.2
pkgrel=1
pkgdesc='Efficient arrays of booleans for Python.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/bitarray/#files'
license=('PSF')
makedepends=('python2-setuptools' 'python-setuptools')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2f730217146e69ff6d8eca3f46c57e43305518a6f263f10acd7302591990f565780747c88f62d0d2b11648f8d35977ec011697088778b02416edf532e7f2770b')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-bitarray() {
  depends=('python2')

  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-bitarray() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

